home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / lib / obsolete / fillcontour.pro < prev    next >
Text File  |  1997-07-08  |  2KB  |  71 lines

  1. ; $Id: fillcontour.pro,v 1.3 1997/01/15 04:02:19 ali Exp $
  2. ;
  3. ; Copyright (c) 1991-1997, Research Systems, Inc.  All rights reserved.
  4. ;    Unauthorized reproduction prohibited.
  5. ;+
  6. ; NAME:    
  7. ;    FILLCONTOUR
  8. ; PURPOSE:
  9. ;    Contour, /fill does not fill the lowest contour level.
  10. ;    FILLCONTOUR attempts to fill that level.
  11. ; CATEGORY:
  12. ;    Plot
  13. ; CALLING SEQUENCE:
  14. ;    FILLCONTOUR, data, x, y, ......(keyword parameters)
  15. ; INPUTS:
  16. ;    data     - 2 dimensional data displayable with CONTOUR command.
  17. ;    x, y      - x and y coordinates (see description on CONTOUR)
  18. ;
  19. ;    KEYWORD INPUTS:
  20. ;        All the contour keywords are allowed.
  21. ;
  22. ; OUTPUTS:
  23. ;    A filled contour plot to the current graphics device.
  24. ; COMMON BLOCKS:
  25. ;    None.
  26. ; SIDE EFFECTS:
  27. ;    None.
  28. ; RESTRICTIONS:
  29. ;    Does not work with certain map projections.
  30. ; PROCEDURE:
  31. ;    Pretty much Straightforward.
  32. ; MODIFICATION HISTORY:
  33. ;       July, 1993 JIY - Initial creation
  34. ;-
  35.  
  36.  
  37. pro fillcontour, data, x, y, _extra = _extra
  38.  
  39.    on_error, 2
  40.  
  41.    if (not keyword_set(data)) then $
  42.       message, 'Incorrect number of arguments', /traceback
  43.  
  44.    if keyword_set(_extra) then begin
  45.       list  = tag_names (_extra)
  46.       for i=0,n_elements(list)-1 do begin
  47.          if (strmid("C_COLORS",0,strlen(list(i))) eq list(i)) then $
  48.             color = _extra.(i)(0)
  49.          if (strmid("FILL",0,strlen(list(i))) eq list(i)) then $
  50.             _extra.(i) = 0
  51.       endfor
  52.    endif
  53.  
  54.    dsize = size (data)
  55.  
  56.    if (dsize(0) ne 2) then $
  57.       message, 'Array must have 2 dimensions',/traceback
  58.  
  59.    if not keyword_set(x) then x = lindgen(dsize(1))
  60.    if not keyword_set(y) then y = lindgen(dsize(2))
  61.   
  62.    if (not keyword_set(color)) then color = 30
  63.    contour, data, x, y, /nodata, /xsty, /ysty, _extra=_extra
  64.    polyfill, !x.window([0,1,1,0,0]),!y.window([0,0,1,1,0]), color=color,/norm
  65.    contour, data, x, y, _extra=_extra, /fill,/xsty,/ysty,/over
  66.    tick = replicate(' ',30)
  67.    axis, xax=0, /xsty, xtickname=tick
  68.    axis, xax=1, /xsty, xtickname=tick
  69.    axis, yax=0, /ysty, ytickname=tick
  70.    axis, yax=1, /ysty, ytickname=tick
  71. end